<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateShopProvinceTargetTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('open_shop_province_target', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('provinceCode')->default(0)->comment('省区code');
            $table->unsignedInteger('yearMonth')->default(0)->comment('年月：2022101  年度是2022');
            $table->unsignedSmallInteger('openNum')->default(0)->comment('目标新开');
            $table->unsignedSmallInteger('closeNum')->default(0)->comment('目标闭店');
            $table->unsignedSmallInteger('stockNum')->default(0)->comment('目标在营业,存量');

            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment = '门店省区目标表';

            $table->index('provinceCode', 'idx_provinceCode');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('open_shop_province_target');
    }
}
